RichTextKit v0.4

Slice<T> Struct

Assembly: Topten.RichTextKit.dll
Namespace: Topten.RichTextKit.Utils

Represents a slice of an array

public struct Slice<T> :
    IEnumerable<T>

Inheritance

Slice<T> → ValueTypeobject

Interfaces

IEnumerable<T>, System.Collections.IEnumerable

Type Parameters

T

The array type

Constructors

Slice(T[])

Constructs a new slice covering the entire passed array.

Slice(T[], int, int)

Constructs a new slice for part of the passed array.

Properties

Empty

A shared empty slice of type T

Item[int]

Gets a reference to an element in the slice

Length

Gets the length of the array slice.

Start

Gets the offset of this slice within the underlying array

Underlying

Gets the underlying array

Methods

AsSpan()

Get the slice as a Span

Clear()

Clears the entire slice content

Copy()

Creates a copy of this slice on a new underlying array

Fill(T)

Fill the slice with a specified value

IndexOf(T)

Find the first index of a specified value

IndexOfAny(params T[])

Find the first index of one or more valus

Replace(T, T)

Replace all instances of a value with another

Set(Slice<T>)
Split(T)

Split this slice on a delimiter

SubSlice(int)

Creates a subslice of an array slice, from a specified position to the end

SubSlice(int, int)

Creates a sub-slice of this slice

ToArray()

Gets the slice contents as a new array